package com.springbootbase.springbootproject.mapper;

import com.springbootbase.springbootproject.pojo.Evaluation;
import com.springbootbase.springbootproject.pojo.MentorData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface SupervisorMapper {

    @Select("SELECT * FROM evaluation WHERE school LIKE CONCAT('%',#{university},'%') AND college LIKE CONCAT('%',#{department},'%') AND username LIKE CONCAT('%',#{supervisor},'%')")
    ArrayList<Evaluation> getComment(String university, String department, String supervisor);

    @Select("select DISTINCT  username from evaluation where school LIKE CONCAT('%',#{university},'%') AND college LIKE CONCAT('%',#{department},'%')")
    List<String> getSupervisor(String university, String department);

    @Select("select * from mentor_data where supervisor LIKE CONCAT('%',#{supervisor},'%')  AND university LIKE CONCAT('%',#{university},'%') AND department LIKE CONCAT('%',#{department},'%')")
    MentorData getInfo(String university, String department, String supervisor);
}
